package com.eastshop.product.vo;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import org.apache.commons.lang3.builder.ToStringBuilder;

import com.eastshop.category.vo.Category;


/** @author Hibernate CodeGenerator */
public class Product implements Serializable {

    /** identifier field */
    private Integer pid;

    /** nullable persistent field */
    private String pname;

    /** nullable persistent field */
    private Double price;

    /** nullable persistent field */
    private String image;

    /** nullable persistent field */
    private String pdesc;

    /** nullable persistent field */
    private Date pdate;

    /** nullable persistent field */
    private Integer hotNum;

    /** nullable persistent field */
    private Integer sales;

    /** persistent field */
    private Category category;

    /** persistent field */
    private Set orderitems;

    /** full constructor */
    public Product(String pname, Double price, String image, String pdesc, Date pdate, Integer hotNum, Integer sales, Category category, Set orderitems) {
        this.pname = pname;
        this.price = price;
        this.image = image;
        this.pdesc = pdesc;
        this.pdate = pdate;
        this.hotNum = hotNum;
        this.sales = sales;
        this.category = category;
        this.orderitems = orderitems;
    }

    /** default constructor */
    public Product() {
    }

    /** minimal constructor */
    public Product(Category category, Set orderitems) {
        this.category = category;
        this.orderitems = orderitems;
    }

    public Integer getPid() {
        return this.pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public String getPname() {
        return this.pname;
    }

    public void setPname(String pname) {
        this.pname = pname;
    }

    public Double getPrice() {
        return this.price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getImage() {
        return this.image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getPdesc() {
        return this.pdesc;
    }

    public void setPdesc(String pdesc) {
        this.pdesc = pdesc;
    }

    public Date getPdate() {
        return this.pdate;
    }

    public void setPdate(Date pdate) {
        this.pdate = pdate;
    }

    public Integer getHotNum() {
        return this.hotNum;
    }

    public void setHotNum(Integer hotNum) {
        this.hotNum = hotNum;
    }

    public Integer getSales() {
        return this.sales;
    }

    public void setSales(Integer sales) {
        this.sales = sales;
    }

    public Category getCategory() {
        return this.category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public Set getOrderitems() {
        return this.orderitems;
    }

    public void setOrderitems(Set orderitems) {
        this.orderitems = orderitems;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("pid", getPid())
            .toString();
    }

}
